<?php

/**
 * @name: HOTN AnimeList
 * @author: HammerOnTheNail
 * @link: http://code.google.com/p/hotnanimelist/
 */

// Admin oldal címének meghatározása
$title .= " \ ".HOTN_ANIMELIST_ADMIN_MENU_MANGA_EDIT;
$text = "";

if ($_POST['action'] == "edit")
{
//	require_once(e_HANDLER."upload_handler.php");
//	$uploaded = process_uploaded_files(e_PLUGIN."hotn_animelist/Project/".$data['project_folder'], "unique", array('file_array_name'=>"image"));
}

// Adatok
if ($_POST['action'] == "edit")
{
	
}
elseif ($_POST['action'] == "select")
{
	
}
else
{
	// Projectek
		$sql->db_Select("hotn_animelist_project", "project_id, project_name, project_mode, project_type", "`project_mode` = 'active' and `project_type` = 'manga' ORDER BY project_name ASC");
		while ($row = $sql->db_Fetch())
		{
			if ($row['project_type'] == "manga") $row['project_type'] = HOTN_ANIMELIST_DEFAULT_MANGA;

				$project_active[$row['project_id']] = $row['project_name']." (".$row['project_type'].")";
		}
		
		$project = array(
			HOTN_ANIMELIST_ANIMETYPE_ACTIVE => $project_active
		); 
	// Alap adatok
		$data = array(
			"type" => "form",
			"method" => "post",
			"action" =>  e_SELF."?manga.category",
			"hidden" => array("action"=>"select"),
			"data" => array(
						array(
							"type" => "select",
							"name" => "project_id",
							"group" => "true",
							"selected" => 0,
							"show" => true,
							"value" => $project,
							"text" => HOTN_ANIMELIST_ADMIN_FILE_PROJECT_NAME
						),
						array(
							"type" => "submit",
							"value" => HOTN_ANIMELIST_DEFAULT_FORM_EDIT
						)
			)
		);
}

// Admin oldal tartalmának megjelenítése
$text .= "<div style='text-align: center;'>".$HOTN_ANIMELIST_FORM->show_form($data)."</div>";
?>